import 'package:flutter_base_app/generated/json/base/json_convert_content.dart';
import 'package:flutter_base_app/model/test_data.dart';

TestData $TestDataFromJson(Map<String, dynamic> json) {
  final TestData testData = TestData();
  final String? did = jsonConvert.convert<String>(json['did']);
  if (did != null) {
    testData.did = did;
  }
  final String? sid = jsonConvert.convert<String>(json['sid']);
  if (sid != null) {
    testData.sid = sid;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    testData.title = title;
  }
  final String? summary = jsonConvert.convert<String>(json['summary']);
  if (summary != null) {
    testData.summary = summary;
  }
  final String? newsSrc = jsonConvert.convert<String>(json['newsSrc']);
  if (newsSrc != null) {
    testData.newsSrc = newsSrc;
  }
  final String? pubTime = jsonConvert.convert<String>(json['pubTime']);
  if (pubTime != null) {
    testData.pubTime = pubTime;
  }
  return testData;
}

Map<String, dynamic> $TestDataToJson(TestData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['did'] = entity.did;
  data['sid'] = entity.sid;
  data['title'] = entity.title;
  data['summary'] = entity.summary;
  data['newsSrc'] = entity.newsSrc;
  data['pubTime'] = entity.pubTime;
  return data;
}

extension TestDataExtension on TestData {
  TestData copyWith({
    String? did,
    String? sid,
    String? title,
    String? summary,
    String? newsSrc,
    String? pubTime,
  }) {
    return TestData()
      ..did = did ?? this.did
      ..sid = sid ?? this.sid
      ..title = title ?? this.title
      ..summary = summary ?? this.summary
      ..newsSrc = newsSrc ?? this.newsSrc
      ..pubTime = pubTime ?? this.pubTime;
  }
}